package org.lc.service.system.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.lc.platform.mybatis.entity.BaseEntity;
import org.lc.platform.swagger.interfaces.Add;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * user
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName(autoResultMap = true)
@ToString(callSuper = true)
public class SysRole extends BaseEntity implements Serializable {
    /**
     * 账号
     */
    @NotEmpty(message = "角色名称不能为空", groups = {Add.class})
    @Schema(description = "用户账号", requiredMode = Schema.RequiredMode.REQUIRED)
    private String name;

    /**
     * 用户名
     */
    @NotEmpty(message = "角色代码不能为空", groups = {Add.class})
    @Schema(description = "角色代码", requiredMode = Schema.RequiredMode.REQUIRED)
    public String code;

    /**
     * 是否禁用
     */
    @Schema(description = "是否禁用", defaultValue = "false", type = "boolean")
    private Boolean forbidden;

    /**
     * 备注
     */
    private String remark;

    /**
     * 删除时间
     */
    @TableField(select = false)
    @JsonIgnore
    @Schema(description = "删除标识", hidden = true)
    @TableLogic
    private LocalDateTime deleteTime;


    @Serial
    private static final long serialVersionUID = 1L;
}